<%@page import="java.util.List"%>
<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<jsp:include page="base/header.jsp" flush="true"> 
 <jsp:param value="商品销售明细" name="pageTitle"/>
</jsp:include>

<!--必要样式-->
<link rel="stylesheet" href="<%=BusiConstant.context%>/common/css/style.css" type="text/css" />
<body>
<jsp:include page="base/nav.jsp" flush="true"></jsp:include>

<div id="content" style="margin-left:20px;font-size:12px;">
	<br>
    <div style="height:40px;">
	    <form id="chaxun">
	        <span style="float:none;margin-right:5px;">商品编号</span>
	        <input name="id" id="id" style="width:200px;" type="text" value="">
	        <input onclick="huodonglist(1)" class='self-btn' type="button" value="搜索">
	    </form>
      
    </div>
  
   
    <div >
        <div>	
         	<table id="headtable">
         		<thead></thead>
             	<tbody></tbody>
            </table>
        </div>
        <div id="fanye"></div>
    </div>
</div>

</body>



<script>
	var table = createtable("headtable");
	
	var imgtdfun = function(row){
		var tdinner = "<img style='width:100px;height:100px;' src='"+row.picurl+"'>";
		return tdinner;
	}
	
	table.th = [{w:100,na:"日期",colname:"id"}
	,{w:200,na:"商品名称",colname:"title"}
	,{w:200,na:"销售数量",colname:"sumbbnum"}
	,{w:400,na:"销售金额",colname:"sumfenrun"}
	,{w:100,na:"累计销售量",colname:"totalSaleNum"}
	,{w:100,na:"剩余库存",colname:"kuCunNum"}];
	
	table.thinit();
	
	function sucdo(data){
		var rows = data.resultData.rows;
		if(rows){	
			table.data = rows;
			table.tdinit();		
		}	
	}
	
   function huodonglist(current){
	   var data = formtojson($('#chaxun'));
	   var url = getbaseurl("/order/yingxiaosp.do");
	   postdo(url, data, sucdo,null, null);
   }
   var id = getQueryVariable("id");
   if(id){
	   $("#id").val(id);
	   huodonglist(1);
   }
         
</script>


</html>